package com.yonyou.ncmm_pac_pda;

import com.yonyou.uap.um.application.ApplicationContext;
import com.yonyou.uap.um.base.*;
import com.yonyou.uap.um.common.*;
import com.yonyou.uap.um.third.*;
import com.yonyou.uap.um.control.*;
import com.yonyou.uap.um.core.*;
import com.yonyou.uap.um.binder.*;
import com.yonyou.uap.um.runtime.*;
import com.yonyou.uap.um.lexer.*;
import com.yonyou.uap.um.widget.*;
import com.yonyou.uap.um.widget.UmpSlidingLayout.SlidingViewType;
import com.yonyou.uap.um.log.ULog;
import java.util.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.webkit.*;
import android.content.*;
import android.graphics.*;
import android.widget.ImageView.ScaleType;

public abstract class RefPageActivity extends UMWindowActivity {

	protected UMWindow RefPage = null;
protected XVerticalLayout viewPage0 = null;
protected XHorizontalLayout navigatorbarref = null;
protected UMButton btnback = null;
protected UMLabel label0 = null;
protected XVerticalLayout wpanel0 = null;
protected UMTextbox txtfilter = null;
protected UMListViewBase listviewref = null;
protected XVerticalLayout wpanel1 = null;
protected XHorizontalLayout panel0 = null;
protected UMLabel label1 = null;
protected UMLabel lblrefcode = null;
protected XHorizontalLayout panel1 = null;
protected UMLabel label2 = null;
protected UMLabel lblrefname = null;

	
	protected final static int ID_REFPAGE = 58757551;
protected final static int ID_VIEWPAGE0 = 223662796;
protected final static int ID_NAVIGATORBARREF = 446658827;
protected final static int ID_BTNBACK = 1239355925;
protected final static int ID_LABEL0 = 825313583;
protected final static int ID_WPANEL0 = 1436400400;
protected final static int ID_TXTFILTER = 1593116997;
protected final static int ID_LISTVIEWREF = 462551330;
protected final static int ID_WPANEL1 = 1394795773;
protected final static int ID_PANEL0 = 929786521;
protected final static int ID_LABEL1 = 1658555674;
protected final static int ID_LBLREFCODE = 1064137826;
protected final static int ID_PANEL1 = 911010377;
protected final static int ID_LABEL2 = 1134215501;
protected final static int ID_LBLREFNAME = 290088934;

	
	
	@Override
	public String getControllerName() {
		return "RefPageController";
	}
	
	@Override
	public String getContextName() {
		return "";
	}

	@Override
	public String getNameSpace() {
		return "com.yonyou.ncmm_pac_pda";
	}

	protected void onCreate(Bundle savedInstanceState) {
		ULog.logLC("onCreate", this);
		super.onCreate(savedInstanceState);
        onInit(savedInstanceState);
        
	}
	
	@Override
	protected void onStart() {
		ULog.logLC("onStart", this);
		
		super.onStart();
	}

	@Override
	protected void onRestart() {
		ULog.logLC("onRestart", this);
		
		super.onRestart();
	}

	@Override
	protected void onResume() {
		ULog.logLC("onResume", this);
		
		super.onResume();
	}

	@Override
	protected void onPause() {
		ULog.logLC("onPause", this);
		
		super.onPause();
	}

	@Override
	protected void onStop() {
		ULog.logLC("onStop", this);
		
		super.onStop();
	}

	@Override
	protected void onDestroy() {
		ULog.logLC("onDestroy", this);
		
		super.onDestroy();
	}
	
	public  void onInit(Bundle savedInstanceState) {
		ULog.logLC("onInit", this);
		UMActivity context = this;
		registerControl();
		this.getContainer();
		
		/*
		 new Thread() {
			 public void run() {
				 UMPDebugClient.startServer();
			 }
		 }.start();
		*/
		String sys_debug = ApplicationContext.getCurrent(this).getValue("sys_debug");
		if (sys_debug != null && sys_debug.equalsIgnoreCase("true")) {
			UMPDebugClient.waitForDebug();
		}

		IBinderGroup binderGroup = this;
		currentPage = getCurrentWindow(context, binderGroup);
super.setContentView(currentPage);

		
	}
	
	private void registerControl() {
		  idmap.put("RefPage",ID_REFPAGE);
  idmap.put("viewPage0",ID_VIEWPAGE0);
  idmap.put("navigatorbarref",ID_NAVIGATORBARREF);
  idmap.put("btnback",ID_BTNBACK);
  idmap.put("label0",ID_LABEL0);
  idmap.put("wpanel0",ID_WPANEL0);
  idmap.put("txtfilter",ID_TXTFILTER);
  idmap.put("listviewref",ID_LISTVIEWREF);
  idmap.put("wpanel1",ID_WPANEL1);
  idmap.put("panel0",ID_PANEL0);
  idmap.put("label1",ID_LABEL1);
  idmap.put("lblrefcode",ID_LBLREFCODE);
  idmap.put("panel1",ID_PANEL1);
  idmap.put("label2",ID_LABEL2);
  idmap.put("lblrefname",ID_LBLREFNAME);

	}
	
	public void onLoad() {
		ULog.logLC("onLoad", this);
		if(currentPage!=null) {
			currentPage.onLoad();
		}
	
		{ //viewPage0 - action:viewpage0_onload
    UMEventArgs args = new UMEventArgs(RefPageActivity.this);
    actionViewpage0_onload(viewPage0,args);

}

	}
	
	public void onDatabinding() {
		ULog.logLC("onDatabinding", this);
		super.onDatabinding();
		
	}
	
	@Override
	public void onReturn(String methodName, Object returnValue) {
		
	}

	@Override
	public void onAfterInit() {
		ULog.logLC("onAfterInit", this);
		
		onLoad();
	}
	
		@Override
	public Map<String,String> getPlugout(String id) {
		XJSON from = this.getUMContext();
		Map<String,String> r = super.getPlugout(id);
		
		return r;	
	}
	
	
	
	public View getNavigatorbarrefView(final UMActivity context,IBinderGroup binderGroup) {
navigatorbarref = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_NAVIGATORBARREF
,"color","#323232"
,"padding-left","8"
,"width","fill"
,"font-size","17"
,"valign","center"
,"font-family","default"
,"background-image","navbar_login.png"
,"layout-type","vbox"
,"halign","LEFT"
,"padding-right","8"
,"height","44.0"
);
btnback = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BTNBACK
,"font-pressed-color","#e50011"
,"color","#ffffff"
,"onclick","action:btnback_onclick"
,"width","44"
,"font-size","20"
,"font-family","default"
,"valign","center"
,"background-image","icon_back.png"
,"layout-type","hbox"
,"halign","center"
,"height","44"
);
navigatorbarref.addView(btnback);
label0 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL0
,"bindfield","doctitle"
,"width","0"
,"weight","1"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","center"
,"margin-right","44"
,"height","fill"
);
navigatorbarref.addView(label0);

return navigatorbarref;
}
public View getPanel0View(final UMActivity context,IBinderGroup binderGroup) {
panel0 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_PANEL0
,"padding-left","5"
,"width","fill"
,"weight","1"
,"valign","center"
,"layout-type","vbox"
,"halign","LEFT"
,"height","0"
);
label1 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL1
,"color","#167ef8"
,"heightwrap","20.0"
,"width","wrap"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","center"
,"widthwrap","45.0"
,"content","编码："
,"height","wrap"
);
panel0.addView(label1);
lblrefcode = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LBLREFCODE
,"bindfield","code"
,"color","#167ef8"
,"width","wrap"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","left"
,"widthwrap","30.0"
,"content","编码"
,"height","fill"
);
panel0.addView(lblrefcode);

return panel0;
}
public View getPanel1View(final UMActivity context,IBinderGroup binderGroup) {
panel1 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_PANEL1
,"padding-left","5"
,"width","fill"
,"weight","1"
,"valign","center"
,"layout-type","vbox"
,"halign","LEFT"
,"height","0"
);
label2 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL2
,"color","#000000"
,"heightwrap","20.0"
,"width","wrap"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","center"
,"widthwrap","45.0"
,"content","名称："
,"height","wrap"
);
panel1.addView(label2);
lblrefname = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LBLREFNAME
,"bindfield","name"
,"color","#000000"
,"width","wrap"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","left"
,"widthwrap","30.0"
,"content","名称"
,"height","fill"
);
panel1.addView(lblrefname);

return panel1;
}
public View getWpanel1View(final UMActivity context,IBinderGroup binderGroup) {
wpanel1 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_WPANEL1
,"border-bottom-color","#c0c0c0"
,"background","#ffffff"
,"border-bottom-width","1px"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"height","60"
);
View panel0 = (View) getPanel0View((UMActivity)context,binderGroup);
wpanel1.addView(panel0);
View panel1 = (View) getPanel1View((UMActivity)context,binderGroup);
wpanel1.addView(panel1);

return wpanel1;
}
public View getListviewrefView(final UMActivity context,IBinderGroup binderGroup) {
listviewref = (UMListViewBase)ThirdControl.createControl(new UMListViewBase(context),ID_LISTVIEWREF
,"layout","vbox"
,"bindfield","bdlistdata"
,"onuprefresh","action:listviewref_onuprefresh"
,"width","fill"
,"weight","1"
,"valign","TOP"
,"onitemclick","action:listviewref_onitemclick"
,"layout-type","vbox"
,"ondownrefresh","action:listviewref_ondownrefresh"
,"halign","center"
,"height","0"
);
listviewref.addListItemView("getWpanel1View");

return listviewref;
}
public View getWpanel0View(final UMActivity context,IBinderGroup binderGroup) {
wpanel0 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_WPANEL0
,"background","#f2f2f2"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"height","fill"
);
txtfilter = (UMTextbox)ThirdControl.createControl(new UMTextbox(context),ID_TXTFILTER
,"color","#167ef8"
,"maxlength","256"
,"padding-left","4"
,"onchange","action:txtfilter_onchange"
,"font-size","17"
,"bindfield","keywords"
,"background","#ffffff"
,"width","fill"
,"font-family","default"
,"placeholder","输入编码、名称过滤"
,"layout-type","vbox"
,"halign","LEFT"
,"margin-bottom","10"
,"height","44"
);
wpanel0.addView(txtfilter);
View listviewref = (View) getListviewrefView((UMActivity)context,binderGroup);
wpanel0.addView(listviewref);

return wpanel0;
}
public View getViewPage0View(final UMActivity context,IBinderGroup binderGroup) {
viewPage0 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_VIEWPAGE0
,"background","#F5F5F5"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"onload","action:viewpage0_onload"
,"height","fill"
);
View navigatorbarref = (View) getNavigatorbarrefView((UMActivity)context,binderGroup);
viewPage0.addView(navigatorbarref);
View wpanel0 = (View) getWpanel0View((UMActivity)context,binderGroup);
viewPage0.addView(wpanel0);

return viewPage0;
}
public UMWindow getCurrentWindow(final UMActivity context,IBinderGroup binderGroup) {
RefPage = (UMWindow)ThirdControl.createControl(new UMWindow(context),ID_REFPAGE
,"layout","vbox"
,"controller","RefPageController"
,"namespace","com.yonyou.ncmm_pac_pda"
,"width","fill"
,"valign","TOP"
,"layout-type","linear"
,"halign","center"
,"height","fill"
);
View viewPage0 = (View) getViewPage0View((UMActivity)context,binderGroup);
RefPage.addView(viewPage0);

return (UMWindow)RefPage;
}

	
	public void actionListviewref_onitemclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "listviewref_onitemclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "onitemclick()",UMActivity.getViewId(control),args);
}
public void actionTxtfilter_onchange(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "txtfilter_onchange";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "docfilter_onchange()",UMActivity.getViewId(control),args);
}
public void actionListviewref_ondownrefresh(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "listviewref_ondownrefresh";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "listDownRefresh()",UMActivity.getViewId(control),args);
}
public void actionViewpage0_onload(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "viewpage0_onload";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "onPageLoad()",UMActivity.getViewId(control),args);
}
public void actionListviewref_onuprefresh(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "listviewref_onuprefresh";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "listUpRefresh()",UMActivity.getViewId(control),args);
}
public void actionBtnback_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "btnback_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.btnback_onclick()",UMActivity.getViewId(control),args);
}


}
